//
//  WDPDDescCell.m
//  Zhihuijinfu
//
//  Created by 王笛 on 2017/1/10.
//  Copyright © 2017年 王笛. All rights reserved.
//

#import "WDPDDescCell.h"
#import "WDPDBottom.h"

@interface WDPDDescCell ()
@property (weak, nonatomic) IBOutlet UILabel *valueLabel;

@end

@implementation WDPDDescCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
}

+ (instancetype)descCellWithTableView:(UITableView *)tableView
{
    static NSString *cellID = @"descCell";
    
    WDPDDescCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    
    if (!cell) {
        
        cell = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] lastObject];
    }
    
    return cell;
}

- (void)setBottom:(WDPDBottom *)bottom
{
    _bottom = bottom;
    
    self.valueLabel.text = bottom.value;
    
    [self layoutIfNeeded];
    
    bottom.cellHeight = CGRectGetMaxY(self.valueLabel.frame) + 21;
    
}

@end
